//
//  CFMineTableVC.m
//  CFfuturestalent
//
//  Created by 子yu 刘 on 2018/4/27.
//  Copyright © 2018年 子yu 刘. All rights reserved.
//

#import "CFMineTableVC.h"
#import "CFUserinfoVC.h"
#import "CFRechargeViewController.h"
#import "CFWithdrawVC.h"


@interface CFMineTableVC ()

@end

@implementation CFMineTableVC

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:YES animated:animated];
}

- (void)viewDidAppear:(BOOL)animated{
    [super viewDidAppear:animated];
    if (@available(iOS 11.0, *)) {//解决隐藏导航栏scrollView不能到顶的问题
        self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
    } else {
        self.automaticallyAdjustsScrollViewInsets = NO;
    }
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.btnRecharge.layer.borderWidth = 1;
    self.btnRecharge.layer.borderColor = [UIColor whiteColor].CGColor;
    self.btnWithdraw.layer.borderWidth = 1;
    self.btnWithdraw.layer.borderColor = [UIColor whiteColor].CGColor;
}

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    UIView * view = [[UIView alloc] init];
    view.backgroundColor = DEF_COLOR_HOMEBGCOLOR;
    return view;
}
- (IBAction)touchUser:(id)sender {
    [self goToSet];
}

- (IBAction)rechargeClicked:(id)sender {
    CFRechargeViewController * recharge = (CFRechargeViewController *)[CFUtility getVC:@"CFRechargeViewController" Storyboard:MINE];
    [self.navigationController pushViewController:recharge animated:YES];
}

- (IBAction)withdrawClicked:(id)sender {
    CFWithdrawVC * withdarw = (CFWithdrawVC *)[CFUtility getVC:@"CFWithdrawVC" Storyboard:MINE];
    [self.navigationController pushViewController:withdarw animated:YES];
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    if(indexPath.section == 1){
//        if(indexPath.row == 0){
//            CFTestVC *testVC = (CFTestVC *)[CFUtility getVC:@"CFTestVC" Storyboard:TEST];
//            [self.navigationController pushViewController:testVC animated:YES];
//        }
        NSArray *vcArray = @[@"",@"",@"",@"CFBindCardVC",@""];
        NSArray *storyArray = @[MESSAGE,FINANCIAL,AUTONYM,BANK,SETTing];

        UIViewController *pushVC = [CFUtility getVC:vcArray[indexPath.row] Storyboard:storyArray[indexPath.row]];
        [self.navigationController pushViewController:pushVC animated:YES];
        
        
    }
}

- (void)goToSet{
    CFUserinfoVC * userInfo = (CFUserinfoVC *)[CFUtility getVC:@"CFUserinfoVC" Storyboard:MINE];
    [self.navigationController pushViewController:userInfo animated:YES];
    
}


@end
